Copyright: Copyright ® 1998 by Gary L. McLaughlin


Main
Message Box Master

The Complete Message Box Creation Utility

Copyright 1998 by Gary L. McLaughlin and Hollowpoint Software Systems
All Rights Reserved

Thanks for trying out Message Box Master (MBM). I believe you'll find that MBM is the most complete and flexible message box creation utility around.

If you have suggestions for enhancements, run across a problem or want to give me some feedback, feel free to contact me at GaryMcLaughlin@msn.com. I'd like to hear from you and know what you think about MBM.

Registration

Just a reminder:  MBM is shareware. The readme file has the current registration information.

Using MBM

Using MBM is a simple process:

1. Select MBM from the Add-In menu.

2. Select the options you want and enter the prompt and title text.

3. Click the Preview button to see what your message box will look like.

4. Click either the Copy or Paste button to move the code to the clipboard or your project, respectively.

5. Close MBM by clicking on Exit.

MBM's Controls and Options

MBM's Controls

Preview

This button allows you to view the message box within MBM.  This allows tweaking the options to get the appearance you want without leaving MBM.

Copy to Clipboard

This button copies the message box code to the clipboard for pasting into your project file.

Paste into Project

This button pastes the message box code directly into your project at the code window cursor location.

MBM Help

This button opens MBM's help file (this file).

Exit MBM

Quits MBM and closes its window.

Icon Options

MBM supports all message box icons.  Click on the icons or the radio buttons to select an icon option.

MBM defaults to no icon.

Button Options

All button combinations are supported.  Click on the radio buttons to select a button combination.

MBM defaults to "OK Only".  This option also disables the Variable Return and If-Then-Else code options since only one value can be returned.

Default Button

All of the buttons in the selected button group will be listed in the Default Button area.  Your choice can be selected by clicking the appropriate radio button.

The help button, if selected, cannot be designated as the default button and will not appear in the list box.

MBM defaults to the first listed button as the default button.

Help Options

MBM will add a Help button to the message box if the checkbox is selected.

The Help File Name and Context ID do not need to be specified, but if either the file name or context ID is specified both must be specified.

The browse button can be used to choose the help file from a standard file dialog.

Code Options

MBM's output code can be in three formats:  Standard, Variable Return and If-Then-Else.

Notes for each of these options and examples are below:

Standard
The standard message box format simply displays the message box and does nothing with the button click used to clear the box.

Example Standard Code

Variable Return
The Variable Return option returns the button selected in a variable.  The variable can then be tested to take action based on the button pressed.

MBM allows you to specify the variable name to be used in the code.  The default variable name is "response".

A variable name must be specified if the Variable Return option is selected.

Example Variable Return Code

Add Select Case Code Option
Checking the Add Select Case Code check box will include a Select Case/End Select code block with a case included for each button in the button option group selected.

MBM defaults this option to unselected.

Example Select Case Code

If-Then-Else
MBM's third code option is to set the message box up as an If-Then-Else statement.

The default button will be the value tested against in the If statement.

Example If-Then-Else Code

<> Option
Selecting the <> check box will substitute <> for the = comparison in the If-Then-Else code.

This option defaults to unchecked.

Buttons Value Only

Checking the Buttons Value Only check box allows suppressing the message box constant names in the message box string and including only a numeric total.

Buttons Value Only is applicable to all code options.

This option default to unchecked.

Example Buttons Value Only Code

Title Text

The Title Text is the text that will appear in the message box title bar.

If no title text is provided, the destination application's name will be placed on the title bar at run time.

Title Text is limited to a single line.

Prompt Text

The Prompt Text is the text that will appear in the body of the message box.

MBM allows you to include carriage returns to separate lines in the message box and add white space.  A carriage return may also be the first character in the prompt text to allow for separating the text from the top of the box.

The width of the resulting message box will be set to the longest line of text in the prompt.  Carriage returns will allow some control over the message box width.

Other Options

The remainder of the message box options provided in Visual Basic are supported by MBM and are grouped in the Other Options area.

System Modal Message Box
Visual Basic and MBM default the message box to be application modal.  Checking this option will make the message box application modal.

Set as Foreground WIndow
Checking this option forces the message box to the foreground.

Right Align Text
This option right-aligns the text in the message box on Hebrew and Arabic systems. Included primarily for completeness.

Right-To-Left Reading
This option makes the text read from right to left on Hebrew and Arabic systems. Included primarily for completeness.


Standard Sample
Sample Standard Code

MsgBox "Sample Message Box Text.", vbInformation + vbYesNo + vbDefaultButton2, "Test Title"


Variable Return Sample
Sample Variable Return Code

response = MsgBox("Sample Message Box Text", vbQuestion + vbYesNo + vbDefaultButton2, "Sample Title")


Select Case Sample
Sample Select Case Code

response = MsgBox("Sample Message Box Text", vbQuestion + vbYesNo + vbDefaultButton2, "Sample Title")

Select Case response

Case vbYes

Case vbNo

End Select


If Sample
Sample If-Then-Else Code

If MsgBox ("Sample Message Box Text", vbQuestion + vbYesNo + vbDefaultButton2, "Sample Title") = vbNo Then

Else

End If


Buttons Value Only Sample
Sample Buttons Value Only Code

MsgBox "Sample Message Box Text",  65, "Sample Title"